<%@ tag language="java" pageEncoding="UTF-8" description="分页标签，传入page对象， 翻页默认触发searchForm函数" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ attribute name="page" type="com.choudou5.solr.bean.common.PageResult" required="true" description="page对象"%>

<%@ attribute name="searchFormId" type="java.lang.String" required="false" description="searchForm ID， 默认：searchForm"%>
<%@ attribute name="searchFormFunName" type="java.lang.String" required="false" description="自定义搜索函数名， 默认：FormUtil.searchForm"%>
<%@ attribute name="algin" type="java.lang.String" required="false" description="分页条方向: left/right/center 默认：center"%>

<c:set var="algin" value="${empty algin?'right':algin}" />
<c:set var="searchFormId" value="${empty searchFormId?'searchForm':searchFormId}" />
<c:set var="searchFormFunName" value="${empty searchFormFunName?'FormUtil.searchForm':searchFormFunName}" />

<span class="text-${algin }">
	<%--上一页 --%>
	<c:if test="${page.hasPre }">
		<a class="previous btn btn-simple btn-sm" href="javascript:void(0);" onclick="javascript:${searchFormFunName}('${searchFormId }', '${page.prePage}', '${page.pageSize }');">上一页</a>
	</c:if>
	<c:if test="${!page.hasPre }">
		<a class="previous disabled btn btn-simple btn-sm" href="javascript:void(0);">下一页</a>
	</c:if>

	<%--下一页 --%>
	<c:if test="${page.hasNext }">
		<a class="next btn btn-simple btn-sm" href="javascript:void(0);" onclick="javascript:${searchFormFunName}('${searchFormId }', '${page.nextPage}', '${page.pageSize }');">下一页</a>
	</c:if>
	<c:if test="${!page.hasNext }">
		<a class="next disabled btn btn-simple btn-sm" href="javascript:void(0);">下一页</a>
	</c:if>
</span>